﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;

namespace QuanLyDoiXe
{
    public partial class frmBaoCaoQuangDuongXeChay : Form
    {
        public frmBaoCaoQuangDuongXeChay()
        {
            InitializeComponent();
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void frmBaoCaoQuangDuongXeChay_Load(object sender, EventArgs e)
        {
            string strQuery = "SELECT distinct c.TenDuong, C.SoKmChay, c.XangTieuThu, c.ThoiGianDung, q.BienSoXe, q.NgayChay, q.maqdxc FROM   CHI_TIET_QUANG_DUONG_XE_CHAY c INNER JOIN QUANG_DUONG_XE_CHAY q ON c.MaQDXC = q.MaQDXC ";

            string strCnn = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=QuanLyDoiXe.accdb";
            OleDbDataAdapter da = new OleDbDataAdapter(strQuery, strCnn);

            QuanLyDoiXeDataset dts = new QuanLyDoiXeDataset();
            da.Fill(dts, "QuangDuongXeChay");

            rptBaoCaoQuangDuongXeChay rptQuangDuongXeChay = new rptBaoCaoQuangDuongXeChay();
            rptQuangDuongXeChay.SetDataSource(dts);
            rptViewerQuangDuongXeChay.ReportSource = rptQuangDuongXeChay;
        }
    }
}
